import time,logging,yaml,yagmail
import pytest,os
# 日志
def log():
    logging.basicConfig(filename='rizhi/api_test.log',
                        level=logging.DEBUG,
                        format='%(asctime)s' '(filename)' '%(message)s' '%(levelname)s' '%(lineno)d',
                        filemode='w+'
                        )

# allure报告
def allure():
    pytest.main(['-s','Test_case/Test_case.py','--alluredir=.report','--clean-alluredir'])
    os.system('allure generate .report -o  report --clean')


# 邮件
def youjian(file):
    mail=yagmail.SMTP(user='2018675435@qq.com',password='nnqakcckuzyqfebd',host='smtp.qq.com')
    mail.send(to='2018675435@qq.com',subject='UI自动化',contents=file)
    return mail



